; FILE: calc.asm
; DESCRIPTION: contains calc function
.386
.model flat, c
.data
	extrn k:dword ;link for global variable
.code
	; calc implementation
	calc proc a:dword, d:dword, b:byte
		; coverting 1 byte integer to 4 bytes integer
		mov al, b
		cbw
		cwde
		; making A4 + B1
		add eax, a
		; making A4+B1-D4
		sub eax, d
		; making A4+B1-D4+K
		add eax, k
		ret
	calc endp
end
